var num = document.querySelector('input');
var btn = document.querySelector('button');
btn.onclick = function () {
    var number = num.value;
    if (number.match(/[0-9]/g)) {
        if (number % 2 == 0) {
            console.log(number + "是偶数");
        } else {
            console.log(number + "是奇数");
        }
    } else {
        console.log(number + " 不是数字")
    }
}